FileGetPos function

Syntax
FileSetPos refNum, mark

Description
Gets the mark (current position) in a file opened with FileOpen. Future FileRead and FileWrite operations always begin at the file’s current mark. When FileOpen opens a file, the file’s mark is set to 0 (zero). After reading or writing data in the file, the mark is set following the last character read or written.

Examples
Variable theFile, refNum, theData, mark
theFile = (FindFolder "desk") & "FileIO Demo"
File(theFile).Text = "First line" & Return & "Second line"
refNum = FileOpen theFile
theData = FileRead refNum, "until", Return      // Reads data until the first carriage return
mark = FileGetPos refNum      // Gets the current position in the file
FileClose refNum
Message "The first carriage return occurs at byte " & mark

See Also
Using the FileIO extension (page 136)

Author Info
FileGetPos, part of FileIO Extension
Copyright © 1998 Life OnLine Software (lr). All rights reserved.